<template>
	<div>
		<v-button theme="primary" size="small" @click=open>查看</v-button> 
		<v-button theme="danger" size="small" @click=remove>删除</v-button>
	</div>
</template>

<script>	
	export default {
		data: () => ({
			id: 0,
			media:"",
			model: {},
			title:"",
			keywords:"",
			mchtId:""
		}),
		methods: {
		    reload() {
					this.$dispatch("reload");
				},
			  open() {
					this.$dispatch("open",this.model);
				},
				remove() {
					let self = this;
					let data = {
						title: "删除操作",
						content: "您是否要删除关键词为" + self.keywords + "的规则?"
					}
					Midway.confirm(data).then(function () {
						let _data = {
							respMsgId: self.id,
							mchtId: self.mchtId
						}
						self.$post({
							url: "/api/v1" + projectName_Url + "/wechat/respMsg/del.html",
							data: _data
						}).then((response) => {
							let message = {
								title:"操作提示",
								content:"删除关键词为" + self.keywords +"的规则成功"
							}
							Midway.alert(message);
							self.reload();
						},error =>{});
					})
				}
		}
	}
</script>